package com.lcf.test;

import com.lcf.demo.Vehicle;

import java.util.Scanner;

public class Demo4 {
    public static void main(String[] args) {
//        实例化一个交通工具对象
        Vehicle vehicle = new Vehicle();
//        显式初始化
        vehicle.setSpeed(50);
        vehicle.setSize(2.5);

//        打印速度和体积
        System.out.println("Inital speed" + vehicle.getSpeed());
        System.out.println("Size " + vehicle.getSize());
//         调用移动方法
        vehicle.move();
//        调用加速方法
        vehicle.speedUp();
        System.out.println("Speed   after speeding up :" + vehicle.getSpeed());

//        调用减速方法
        vehicle.speedDown();
        System.out.println("Speed   after slowing up :" + vehicle.getSpeed());

    }
}
